#include <bits/stdc++.h>

using namespace std;

typedef long long ll;


const int N = 1 << 21 | 1;

ll f[N],g[N];
int n;
char s[N];
void FMT(ll *f,int on) {
    for(int i = 0;i < n;i++)
	for(int j = 0;j < 1 << n;j++)
	    if(j >> i & 1)
		f[j] += f[j ^ (1 << i)] * on;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    scanf("%d",&n); scanf("%s",s); for(int i = 0;i < 1 << n;i++) f[i] = s[i] ^ 48; scanf("%s",s); for(int i = 0;i < 1 << n;i++) g[i] = s[i] ^ 48;
    for(int i = 0;i < 1 << n;i++) f[i] = f[i] << (__builtin_popcount(i) << 1); FMT(f,1);
    for(int i = 0;i < 1 << n;i++) g[i] = g[i] << (__builtin_popcount(i) << 1); FMT(g,1);
    for(int i = 0;i < 1 << n;i++) f[i] = f[i] * g[i]; FMT(f,-1);
    for(int i = 0;i < 1 << n;i++) printf("%lld",(f[i] >> (__builtin_popcount(i) << 1)) & 3); puts(""); return 0;
}
